package com.net.oil.order.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.order.bean.MaintainDetailBean;
import com.net.oil.order.contract.MaintainDetailContract;
import com.net.oil.order.model.MaintainDetailModel;

/**
 * 作者：lch
 * 时间：2018/6/7 0007:下午 22:06
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class MaintainDetailPresenter extends BasePresenter<MaintainDetailContract.View> implements MaintainDetailContract.Presenter {

    private MaintainDetailContract.View view;
    private MaintainDetailContract.Model model;

    public MaintainDetailPresenter(MaintainDetailContract.View view) {
        this.view = view;
        model = new MaintainDetailModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getMaintainDetail(int id) {
        model.getMaintainDetail(id);
    }

    @Override
    public void getMaintainDetailSuccess(MaintainDetailBean maintainDetailBean) {
        view.getMaintainDetailSuccess(maintainDetailBean);
    }

    @Override
    public void getMaintainDetailFailed() {
        view.getMaintainDetailFailed();
    }

    @Override
    public void commitCommentSuccess() {
        view.commitCommentSuccess();
    }

    @Override
    public void commitCommentFailed() {
        view.commitCommentFailed();
    }

    @Override
    public void commitComment(int id, int score, String commentDesc) {
        model.commitComment(id, score, commentDesc);
    }
}
